package com.cn.项目.飞机预约管理系统.Logining;
import com.cn.项目.飞机预约管理系统.Maininterface.MenuJframe;
import javax.swing.*;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import com.cn.项目.飞机预约管理系统.Maininterface.MenuJframe;
import com.cn.项目.飞机预约管理系统.UserFrame.UserMainFrame;


public class UserClient {
    public static void main(String[] args) {
        try {
            User user1;
            ObjectOutputStream os1;
            ObjectInputStream oi1;
            String user = null;
            String pwd = null;

            user1=new User(user,pwd);
            //创建客户端socket对象
            Socket s = new Socket("192.168.43.12",10099);
            //发送数据
            os1=new ObjectOutputStream(s.getOutputStream());
            os1.writeObject(user1);
            //反馈
            oi1=new ObjectInputStream(s.getInputStream());
            String str=(String)oi1.readObject();
            if (str.equals("true")){
                JOptionPane.showMessageDialog(null,"学生用户登录成功","提示", JOptionPane.INFORMATION_MESSAGE);
            }else{
                JOptionPane.showMessageDialog(null,"用户名或密码错误","提示",JOptionPane.ERROR_MESSAGE);                    }
        }  catch (Exception e) {
            e.printStackTrace();
        }
    }
    

}
